package config_order.config;

import config_order.bean.Bean1;
import config_order.bean.Bean2;
import org.springframework.beans.factory.annotation.Autowire;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Component;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2022-10-12 17:52
 */
@Component
public class AutowireDemo2 {

	@Autowired
	private TransactionTest transactionTest;

	/**
	 * ww_s Autowire 是作用在入参依赖注入上面的（getBean1）怎么使用的 还没弄清楚
	 * @param getBean1
	 * @return
	 */
	@Bean
	public Bean2 getBean2(Bean1 getBean1){
		Bean2 bean2 = new Bean2(getBean1.getName(),getBean1.getAge(),getBean1.getType());
		System.out.println(bean2);
		transactionTest.test();
		return bean2;
	}
}
